package com.wc.AlgoOJ_train.train1.c4.A302;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * @Author congege
 * @Description 天数
 * http://43.138.190.70:8888/p/A302
 * @Date Created in 2024/1/3-14:21
 */
public class Main {
    static int[] months = new int[]{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> days = new ArrayList<>();
        int idx = 0;
        // 计算每一天到1000年1月1日的日期
        for (int y = 1000; y <= 9999; y++) {
            if (isRun(y)) {
                months[2] = 29;
            } else {
                months[2] = 28;
            }
            for (int m = 1; m <= 12; m++) {
                for (int i = 1; i <= months[m]; i++) {
                    days.add(++idx);
                }
            }
        }
        while (sc.hasNext()) {
            String[] ss1 = sc.next().split("/");
            String[] ss2 = sc.next().split("/");
            int y1 = Integer.parseInt(ss1[0]);
            int m1 = Integer.parseInt(ss1[1]);
            int d1 = Integer.parseInt(ss1[2]);
            int y2 = Integer.parseInt(ss2[0]);
            int m2 = Integer.parseInt(ss2[1]);
            int d2 = Integer.parseInt(ss2[2]);
            System.out.println(Math.abs(days.get(re(y1, m1, d1)) - days.get(re(y2, m2, d2))) + 1);
        }

    }

    // 计算每一天到1000年1月1日的日期的天数
    public static int re(int year, int month, int day) {
        int ans = 0;
        for (int y = 1000; y < year; y++) {
            if (isRun(y)) {
                ans += 1;
            }
            ans += 365;
        }
        if (isRun(year)) {
            months[2] = 29;
        } else {
            months[2] = 28;
        }
        for (int i = 1; i < month; i++) {
            ans += months[i];
        }
        ans += day;
        return ans;
    }

    public static boolean isRun(int year) {
        return year % 4 == 0 && year % 100 != 0 || year % 400 == 0;
    }
}
